package metier;

import java.util.Vector;

public class Table
{	

	private int numTab;
	private int nbPlace;

	public Table(int numTab, int nbPlace)
	{
	super();
	this.numTab = numTab;
	this.nbPlace = nbPlace;
	}
	
	public int getNumTab() 
	{
		return numTab;
	}
	
	public void setNumTab(int numTab) 
	{
		this.numTab = numTab;
	}
	
	public int getNbPlace() 
	{
		return nbPlace;
	}
	
	public void setNbPlace(int nbPlace) 
	{
		this.nbPlace = nbPlace;
	}
	
	public String toString() 
	{
		return numTab + " " + nbPlace;
	}

	public void modifierUneTable(Vector<Table> lesTables)
    {
            int i;
     
            i = 0;
            
            while(i <= (lesTables.size()-1))
            {
                    if(lesTables.get(i).getNumTab() == this.getNumTab())
                    {
                            lesTables.get(i).setNbPlace(this.getNbPlace());                            
                    }
                    else
                    {
                            i++;
                    }
            }               
    }

}
